package com.gzw.dms;

import android.app.Application;
import android.content.Context;

import com.baidu.location.BDLocationListener;
import com.baidu.location.LocationClient;
import com.gzw.dms.bean.UserInfo;
import com.gzw.dms.impl.MyLocationListener;
/**
 * Created by GaoZhiWei on 2015/12/22.
 */
public class MyApplication  extends Application{
    private static Context mContext;
    private static UserInfo userInfo;
    private static boolean isUserLogin=false;
    private static int flag=-1;
    private static String  lng;//经度
    private static String lat;//维度

    public  LocationClient mLocationClient = null;
    public BDLocationListener myListener = new MyLocationListener();
    private static String loginType;//
    private static String random;
    @Override
    public void onCreate()
    {
        super.onCreate();
        mContext=getApplicationContext();
        mLocationClient = new LocationClient(getApplicationContext());     //声明LocationClient类
        mLocationClient.registerLocationListener( myListener );    //注册监听函数
    }


    public static Context getmContext() {
        return mContext;
    }

    public static void setmContext(Context mContext) {
        MyApplication.mContext = mContext;
    }

    public static UserInfo getUserInfo() {
        return userInfo;
    }

    public static void setUserInfo(UserInfo userInfo) {
        MyApplication.userInfo = userInfo;
    }

    public static boolean getIsUserLogin() {
        return isUserLogin;
    }

    public static void setIsUserLogin(boolean isUserLogin) {
        MyApplication.isUserLogin = isUserLogin;
    }

    public static int getFlag() {
        return flag;
    }

    public static void setFlag(int flag) {
        MyApplication.flag = flag;
    }

    public static String getLng() {
        return lng;
    }

    public static void setLng(String lng) {
        MyApplication.lng = lng;
    }

    public static String getLat() {
        return lat;
    }

    public static void setLat(String lat) {
        MyApplication.lat = lat;
    }

    public static String getLoginType() {
        return loginType;
    }

    public static void setLoginType(String loginType) {
        MyApplication.loginType = loginType;
    }

    public static String getRandom() {
        return random;
    }

    public static void setRandom(String random) {
        MyApplication.random = random;
    }
}
